package com.pikaqiu.warehouse.domain.req;

import com.pikaqiu.warehouse.domain.entity.Materials;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Author: Administrator
 * @Date: 2024/8/14
 */
@Data
public class MaterialForm {
    private Integer id;
    private String code;
    private String name;
    private String desc;
    private String unit;
    private Integer category;
    private BigDecimal stock;
    private String image;
    private BigDecimal price;
    private BigDecimal salary;

    public Materials toMaterials() {
        Materials materials = new Materials();
        materials.setId(id);
        materials.setCode(code);
        materials.setName(name);
        materials.setUnit(unit);
        materials.setSalary(salary);
        materials.setPrice(price);
        materials.setDescription(desc);
        materials.setCategory(category);
        materials.setStock(stock);
        materials.setImages(image);
        return materials;
    }
}
